package com.example.ymm.modules1.mapper.my.user;

import com.example.ymm.base.CoreMapper;
import com.example.ymm.modules1.entity.my.user.DbIntegralLog;
import com.example.ymm.modules1.entity.my.user.DbUser;
import com.example.ymm.modules1.service.dto.DbIntegralLogQueryCriteria;
import com.example.ymm.modules1.service.dto.SysRankingListDto;
import com.example.ymm.modules1.service.dto.SysRankingQueryCriteria;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface DbIntegralLogMapper extends CoreMapper<DbIntegralLog> {

    /**
     * 电脑排行榜
     * @param criteria
     * @return
     */
    List<SysRankingListDto> sysRankingList(SysRankingQueryCriteria criteria);

    List<SysRankingListDto> rankingIntegralList(SysRankingQueryCriteria criteria);

    Integer countUserIntegral(DbIntegralLogQueryCriteria criteria);

    //获得连续打卡出错的人员
    List<DbUser> getContinuousNumCompensation();

    /**
     *
     * @param criteria
     *  isSumRead 是否汇总读书积分
     *                  1 读书积分=读书获取的积分+满勤+连续签到
     *                  null 总积分= 1+表扬奖励积分
     * @return
     */
    Integer sumIntegralTotal(SysRankingQueryCriteria criteria);


    /**
     * 用户剩余积分
     * @param criteria
     * @return
     */
    Double allTotalResidue(SysRankingQueryCriteria criteria);

}